package cn.itcast.myString;

/**
 * @Author : 叶荻风
 * @create : 2024/8/29 11:46
 */
public class StringTest {
    public static void main(String[] args) {
        String s = new String("1");
        String s1 = new String("1");
        s1.intern();
        String s2 = "1";
        System.out.println(s1 == s2);
        String s3 = new String("1") + new String("1");
        String s4 = "11";
        s3.intern();
        System.out.println(s3.intern() == s4);
    }
}
